import * as url from '../constants/api';
import req from '@/utils/request';

// 获取所有角色列表
export function getRoleList (params) {
    return req({
        method: 'GET',
        url: url.ROLE,
        params
    });
}
// 新增角色
export function addRole (params) {
    return req({
        method: 'POST',
        url: url.ROLE,
        data: params
    });
}
// 根据ID获取角色详情
export function updateRole (id) {
    return req({
        method: 'GET',
        url: url.ROLEDETAILS + id
    });
}
// 根据ID更新角色
export function getRoleDetails (id) {
    return req({
        method: 'GET',
        url: url.ROLEDETAILS + id
    });
}

// 根据id查询企业
export function getCompany (id) {
    return req({
        method: 'GET',
        url: url.COMPANY + id
    });
}